<!DOCTYPE html>

<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>BOM: window</title>
</head>
<body>
    <h3>window.open( url , name [ , features ] )</h3>

    <button type="button" onclick="openWindow()">点我打开新窗口</button>
    <button type="button" onclick="closeWindow()">点我关闭新窗口</button>
    <script type="text/javascript">
        let anotherWindow ;
        function openWindow(){
            let url = 'window-move-resize.html' ;
            let name = '_blank' ;
            let features = `titlebar=no,
                            resizable=no,
                            scrollbars=yes,
                            status=yes,
                            channelmode=yes,
                            width=600,
                            height=400,
                            left=200,
                            top=100` ;
           anotherWindow = window.open( url , name , features );
        }

        function closeWindow(){
            anotherWindow.close()
        }
    </script>

</body>
</html>